package com.zh.factorymode.demo.resultfactory;

import java.time.LocalDate;

public class DateResultFactory extends DefaultResultFactory<LocalDate>{

    public LocalDate CreateFromDate(int y, int m, int d) {
        if (y == 0 && m == 0 && d == 0) {
            throw new UnsupportedOperationException("ResultSet.InvalidZeroDate");
        }else{
            return LocalDate.of(y, m, d);
        }
    }

    public LocalDate CreateFromNull(){
        return null;
    }

    public String getTargetTypeName() {
        return LocalDate.class.getName();
    }

}
